﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Security.RightsManagement;
using System.Text;
using System.Threading.Tasks;
using WorkshopModule.Enums;
//车间详情
namespace WorkshopModule.Models {
    internal class WorkShopDetail : INotifyPropertyChanged {
        //属性变更通知
        public event PropertyChangedEventHandler? PropertyChanged;
        // 静态属性变更通知事件
        public static event EventHandler<PropertyChangedEventArgs> StaticPropertyChanged;
        //锁
        private static readonly object _lock = new();

        //车间总数量,可能不用
        //private static int _totalWorkshops;
        //public static int TotalWorkshops {
        //    get { lock (_lock) { return _totalWorkshops; } }
        //    set {
        //        lock (_lock) { _totalWorkshops = value; }
        //        // 触发静态事件，sender 传 null 或类名
        //        StaticPropertyChanged?.Invoke(null, new PropertyChangedEventArgs(nameof(TotalWorkshops)));
        //    }
        //}


        //车间编号
        private int _WorkShopId;
        public int WorkShopId {
            get { return _WorkShopId; }
            set { _WorkShopId = value; }
        }


        //机台/设备数量
        private uint _DeviceNumber;
        public uint DeviceNumber {
            get { return _DeviceNumber; }
            set { _DeviceNumber = value; }
        }


        //车间类型
        private WorkShopType _WorkShopType;
        public WorkShopType WorkShopType {
            get { return _WorkShopType; }
            set {
                _WorkShopType = value;
                if (PropertyChanged != null) {
                    PropertyChanged(this, new PropertyChangedEventArgs("WorkShopType"));
                }
            }
        }

        //车间状态
        //private WorkShopStatus _WorkShopStatus;
        //public WorkShopStatus WorkShopStatus {
        //    get { return _WorkShopStatus; }
        //    set { _WorkShopStatus = value;
        //        if (PropertyChanged != null) {
        //            PropertyChanged(this, new PropertyChangedEventArgs("WorkShopStatus"));
        //        }
        //    }
        //}



    }
}
